home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / osr5 / sco / scripts / admin / news / threaded < prev   
Encoding:
AWK Script  |  1997-08-26  |  650 b   |  31 lines

  1. #!/usr/bin/awk -f
  2. # @(#) threaded.awk 1.0 94/02/02
  3. # 94/02/02 John H. DuBois III
  4. BEGIN {
  5.     if (ARGC > 0) {
  6.     print \
  7. "threaded: Tell how many articles were threaded on each day covered by the\n"\
  8. "mthreads log file."
  9.     exit 0
  10.     }
  11.     File = "/usr/lib/news/rn/mt.log"
  12.     FS = "[+ ]+" 
  13.     while ((ret = (getline < File)) == 1) {
  14.     if ($7 != "added")
  15.         continue
  16.     Date = substr($0,1,6)
  17.     if (Date != LastDate) {
  18.         if (Count)
  19.         printf "%s %5d\n",LastDate,Count
  20.         LastDate = Date
  21.         Count = 0
  22.     }
  23.     Count += $8
  24.     }
  25.     if (ret)
  26.     printf "%s: Error reading file.\n",File | "cat 1>&2"
  27.     else
  28.     if (Count)
  29.         printf "%s %5d\n",LastDate,Count
  30. }
  31.